if (Counter = 1) and (Temp <> ("Great Canadian Scientists Player Record" & RETURN)) then
FileError(0)
end if
if (Temp = EMPTY) and (Counter <= LengthOfFile) then
FileError(1)
end if
if (Temp <> EMPTY) and (Counter > LengthOfFile) then
FileError(2)
end if
if the result = 1 then
put "ERROR"
exit
end if
end repeat
ReadScoreFile()
ScoreDisplay()
if value(field "FinalScore") < 20000 then
put "Kindergarten" into field "Level"
else
if value(field "FinalScore") < 40000 then
put "Elementary" into field "Level"
else
if value(field "FinalScore") < 60000 then
put "High School" into field "Level"
else
if value(field "FinalScore") < 80000 then
put "University" into field "Level"
else
if value(field "FinalScore") < 100000 then
put "Scientist" into field "Level"
else
put "Q" into field "Level"
end if
end if
end if
end if
end if
end
on ReadScoreFile
global name
set ReadScores to FileIO(mnew, "read", name)
set IDLine to ReadScores(mReadLine)
set Temp to value(ReadScores(mReadLine))
if Temp = 0 then
put "Easy" into field "Difficulty"
end if
if Temp = 1 then
put "Medium" into field "Difficulty"
end if
if Temp = 2 then
put "Hard" into field "Difficulty"
end if
set Temp to integer(value(ReadScores(mReadLine)))
set Temp to integer(value(ReadScores(mReadLine)))
set Temp to integer(value(ReadScores(mReadLine)))
set Temp to integer(value(ReadScores(mReadLine)))
set Temp to integer(value(ReadScores(mReadLine)))
put integer(value(ReadScores(mReadLine))) into field "SalmonFishing"
put integer(value(ReadScores(mReadLine))) into field "MemoryTesting"
put integer(value(ReadScores(mReadLine))) into field "ChromosomePairing"
put integer(value(ReadScores(mReadLine))) into field "PatternMatching"
put integer(value(ReadScores(mReadLine))) into field "MapAnalysing"
set Temp to integer(value(ReadScores(mReadLine)))
put integer(value(ReadScores(mReadLine))) into field "AtomReacting"
put value(ReadScores(mReadLine)) into field "PopQuizScore"
ReadScores(mdispose)
FilterName()
put name into field "Name"
end
on FilterName
global name
set Temp to name
set name to EMPTY
if the machineType <> 256 then
repeat while the last char in Temp <> ":"
put the last char in Temp before char 1 of name
delete char -30000 of Temp
end repeat
else
repeat while the last char in Temp <> "\"
put the last char in Temp before char 1 of name
delete char -30000 of Temp
end repeat
end if
end
on FileError Num
put Num
alert("There is either something wrong with the selected record file or it isn't a Great Canadian Scientists record file. Please choose another file.")